<script lang="ts" setup>
import { computed } from 'vue';

interface Props {
	src?: string;
	width?: string;
	height?: string;
}

const props = withDefaults(defineProps<Props>(), {
	width: '100rpx',
	height: '100rpx'
});

const style = computed(() => {
	return {
		width: props.width,
		height: props.height
	};
});
</script>

<template>
	<view class="x-avatar" :style="style">
		<x-image :src="src" :width="width" :height="height"></x-image>
	</view>
</template>

<style lang="scss" scoped>
.x-avatar {
	background-color: #fff;
	border-radius: 200rpx;
	overflow: hidden;
}
</style>
